<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<script type="text/javascript">
	function HandleRemindersDialog(customerId) {
		return new InfoDialog({
			url: '<c:url value="/customer/openReminders.diag"/>?id='+customerId,
			title: "Lembretes de " + $("#name").val(),
			width: 600,
			resizable: false
		});
	}
	
	var reminderDialog = null;
	$(document).ready(function() {
		$("#openReminders").button({
			text : false,
			icons : {
				primary : "ui-icon-note"
			}
		}).click(function(e) {
			e.preventDefault();
			var customerId = $("#customerId").val();
			if (customerId == "") {
				alert("Selecione o cliente que deseja acessar os lembretes");
			} else {
				reminderDialog = new HandleRemindersDialog(customerId);
				reminderDialog.open();
			}
		});
	});
</script>